using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NCS.Module.CongTy.Library.Providers;

namespace NCS.Module.CongTy.Library.Controler
{
    public class CongTyControler
    {
        /// <summary>
        /// Get all data with TrangThai = 1
        /// </summary>
        /// <returns></returns>
        public static DataTable GetCongTyAvailable()
        {
            return DataAccessProvider.instance().GetCongTyAvailable();
        }

        /// <summary>
        /// Get all data
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllCongTy()
        {
            return DataAccessProvider.instance().GetAllCongTy();
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="iStatus"></param>
        /// <returns>all record that had TrangThai=1</returns>
        public static DataTable GetAllCongTyFilter(int iStatus)
        {
            return DataAccessProvider.instance().GetAllCongTyFilter(iStatus);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns>return one record</returns>
        public static CongTyInfo GetInfo(int id)
        {
            return DataAccessProvider.instance().GetInfo(id);
        }

        /// <summary>
        /// Set index of record
        /// </summary>
        /// <param name="id"></param>
        /// <param name="index"></param>
        /// <returns>return number of record changes</returns>
        public static int SetIndex(int id, int index)
        {
            return DataAccessProvider.instance().SetIndex(id, index);
        }

        /// <summary>
        /// Set status 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="status"></param>
        /// <returns>return number of records changes</returns>
        public static int SetStatus(int id, bool status)
        {
            return DataAccessProvider.instance().SetStatus(id, status);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="objCongTyInfo"></param>
        /// <returns>return number of record changes</returns>
        public static int CreateCongTy(CongTyInfo objCongTyInfo)
        {
            return DataAccessProvider.instance().CreateCongTy(objCongTyInfo);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="objCongTyInfo"></param>
        /// <returns>return number of record changes</returns>
        public static int UpdateCongTy(CongTyInfo objCongTyInfo)
        {
            return DataAccessProvider.instance().UpdateCongTy(objCongTyInfo);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="objCongTyInfo"></param>
        /// <returns>return number of record changes</returns>
        public static int DeleteCongTY(int id)
        {
            return DataAccessProvider.instance().DeleteCongTY(id);
        }
    }
}
